﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MrPP.SerriedCabinet
{
    public class ShelveBoxView : ShelveAbstract
    {

       // [SerializeField]
       // private ShelveBinding _binding = null;
        // Start is called before the first frame update
        void Start()
        {
          //  _binding.onLocation += doLocation;
        }

        private void doLocation(BoxLocation oldValue, BoxLocation newValue)
        {
            CellShelveManager.Instance.selected(oldValue, newValue);
            //if (ShelveBoxManager.IsInitialized) {
            //    ShelveBoxManager.Instance.selected(newValue);


            //}
        }

        // Update is called once per frame
        void Update()
        {

        }

        public override void onPage(int value)
        {
        }

        public override void onScanList(string[] list)
        {
            CellShelveManager.Instance.onScanList(list);
            /*
            if (ShelveBoxManager.IsInitialized)
            {
                ShelveBoxManager.Instance.onScanList(list);


            }*/
        }

        public override void onLocation(BoxLocation oldValue, BoxLocation newValue)
        {
            doLocation(oldValue, newValue);
        }

        public override void onRunning(bool value)
        {
        
        }

        public override void onBinding(Dictionary<string, BoxLocation> data)
        {
        }
    }
}